package com.sparrow.common.ai.behaviortree.node.impl;

import com.sparrow.common.ai.behaviortree.def.BTNodeStatus;
import com.sparrow.common.ai.behaviortree.BehaviorContext;
import com.sparrow.common.ai.behaviortree.node.AbstractBehaviorNode;
import com.sparrow.common.ai.behaviortree.node.BehaviorNode;
import com.sparrow.common.ai.behaviortree.task.BehaviorTask;
import com.sparrow.common.ai.behaviortree.task.impl.ActionTask;

import java.util.Collections;
import java.util.List;

public abstract class ActionNode extends AbstractBehaviorNode {
    @Override
    public BehaviorTask createTask() {
        return new ActionTask(this);
    }

    /**
     * ActionTask 会调用Node tick方法
     * @param context
     * @param now
     * @param delta
     * @return
     */
    public abstract BTNodeStatus tick(BehaviorContext context, long now, long delta);

    @Override
    public List<BehaviorNode> getChildren() {
        return Collections.EMPTY_LIST;
    }


}
